package com.shu.validator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({ElementType.METHOD,ElementType.FIELD})//标注在什么上面，方法，属性
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = MyConstraintValidator.class)//校验逻辑由MyConstraintValidator执行
public @interface MyConstraint {

    String message() ;

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

}
